package fixture;

import java.sql.SQLException;

import vcp.server.DBAdapter;

/**
 * 
 * @author VCP team
 * 
 *         <p>
 *         This class is responsible for testing the correct functionality on
 *         when user tries to cancel order less then 1 hour due to his requested
 *         subscription
 *         </p>
 */
public class OrderCancelationLessThenHoursBeforeFixture extends OrderCancelation3HoursBeforeFixture
{
	@Override
	public boolean customerBalanceChange()
	{
		return this.originBalance.floatValue() != this.refundBalance.floatValue();
	}

	@Override
	public float customerBalanceVerification()
	{
		return this.refundBalance.floatValue();
	}

	@Override
	public void dbChange()
	{
		String subscriberArrivalUpdate = "UPDATE `vcp`.`subscriptions` SET `arrivalDate`='2014-01-01 00:10:00', "
				+ "`estimatedLeaveDate`='2014-01-01 03:00:00' WHERE `subscriptionID`='38' and`customerID`='" + this.customerID + "';";

		try
		{
			DBAdapter.getAdapter().refresh(subscriberArrivalUpdate);
		}
		catch (SQLException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
